/*
 * @Date: 2023-06-23 22:00:33
 * @LastEditTime: 2023-09-25 17:39:55
 * 介绍:
 */
export function isPhone(phone: string) {
  return /^[1][3,4,5,6,7,8,9][0-9]{9}$/.test(phone);
}
/**
 * 是非空字符
 * @param str
 * @returns
 */
export function isNonNullStr(str: string) {
  return str.replace(/\s*/g, "") !== "";
}

export function isUrl(path: string): boolean {
  const reg = /^http(s)?:\/\/([\w-]+\.)+[\w-]+(\/[\w- .\/?%&=]*)?/;
  return reg.test(path);
}

export function isPc() {
  return !/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(
    navigator.userAgent
  );
}
